<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/validators/task.js"></script>

<div class="f_l margin1" style="width:100%">
    <div style="height:24px;color:red" align="center" id="errorInfo">${failInfo }</div>
    <div style="height:24px;color:red;font-weight:bold" align="left">修改任务</div>
    <s:form id="submitForm" action="task!update" method="post" theme="simple">
    <table>
    	<tbody>
    		<tr>
    			<td><s:text name="任务名称"/>：</td>
    			<td><s:property value="task.taskName" /></td>
    		</tr>
    		<tr>
    			<td><s:text name="发 起 人"/>：</td>
    			<td><s:property value="task.creatorName" /></td>
    		</tr>
    		<tr>
    			<td><s:text name="负 责 人"/>：</td>
    			<td><select onchange="javascript:commonSelect(this,'ownerName');" id="ownerName" name="task.ownerId" >
                <option value="">-- 请选择 --</option>
	            <s:iterator value="allChargePersons" status="status">
	                <option <s:if test="id==task.ownerId">selected="true"</s:if> value="${id}">${userName}</option>
	            </s:iterator>
	            </select>
	            <span id="ownerError"></span></td>
    		</tr>
    		<tr>
    			<td><s:text name="开始时间"/>：</td>
    			<td><input readonly="true" id="startDate" style="width:80px" name="task.startDate" value='<s:date name="task.startDate" format="yyyy-MM-dd"/>' onclick="return showCalendar('startDate', 'y-mm-dd');" /><span></span></td>
    		</tr>
    		<tr>
    			<td><s:text name="结束时间"/>：</td>
    			<td><input readonly="true" id="endDate" style="width:80px" name="task.endDate" value='<s:date name="task.endDate" format="yyyy-MM-dd"/>' onclick="return showCalendar('endDate', 'y-mm-dd');" /><span></span></td>
    		</tr>
    		<tr>
    			<td><s:text name="任务状态"/>：</td>
    			<td><select name="task.status">
        							  	<option value="1">处理中</option>
        							  	<option value="2">结束</option>
        							  	<option value="3">延期</option>
        							  </select></td>
    		</tr>
    		<tr>
    			<td><s:text name="任务内容"/>：</td>
    			<td><textarea name="task.content" rows="10" cols="50"><s:property value='task.content' /></textarea><span id="contentError"></span></td>
    		</tr>
    		<tr>
    			<td><input type="submit" value="确认" onclick="return doValidate(event)" /></td>
    			<td><input type="button" value="取消" onclick="window.location.href='task!list'"/></td>
    		</tr>
    	</tbody>
    </table>
    <input type="hidden" name="id" value="<s:property value='task.id' />" />
    </s:form>
</div>
